package com.example.hxds.dr.service.impl;

import cn.hutool.json.JSONUtil;
import com.example.hxds.dr.db.dao.DriverSettingsDao;
import com.example.hxds.dr.service.DriverSettingsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;

/**
 * @ClassName: DriverSettingsServiceImpl
 * @Description: 司机设置实现类
 * @Author: 丛雨
 * @Date: 2024/1/20 16:08
 */
@Service
@Slf4j
public class DriverSettingsServiceImpl implements DriverSettingsService {
    @Resource
    private DriverSettingsDao driverSettingsDao;

    /**
     * 查询司机设置
     *
     * @param driverId 司机Id
     * @return 查询结果
     */
    @Override
    public HashMap searchDriverSettings(long driverId) {
        String settings = driverSettingsDao.searchDriverSettings(driverId);
        HashMap result = JSONUtil.parseObj(settings).toBean(HashMap.class);
        return result;
    }
}
